home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / _gs / !GS / h / IUTIL < prev    next >
Text File  |  1991-10-25  |  3KB  |  77 lines

  1. /* Copyright (C) 1991 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* iutil.h */
  21. /* Prototypes for procedures in iutil.c */
  22.  
  23. /* ------ Object utilities ------ */
  24.  
  25. /* Copy refs from one place to another. */
  26. /* (If we are copying to the stack, we can just use memcpy.) */
  27. extern void refcpy_to_new(P3(ref *to, ref *from, uint size));
  28. extern void refcpy_to_old(P4(ref *to, ref *from, uint size, char *client_name));
  29. /* Fill an array with nulls. */
  30. extern void refset_null(P2(ref *to, uint size));
  31.  
  32. /* Compare two objects for equality.  Return 1 if equal, 0 if not. */
  33. extern int obj_eq(P2(ref *, ref *));
  34.  
  35. /* Create a printable representation of an object, a la cvs. */
  36. /* Return 0 if OK, <0 if the destination wasn't large enough. */
  37. extern int obj_cvs(P4(ref *, byte *, uint, uint *));
  38.  
  39. /* ------ String utilities ------ */
  40.  
  41. /* Compare two strings, returning -1 if the first is less, */
  42. /* 0 if they are equal, and 1 if first is greater. */
  43. /* We can't use memcmp, because we always use unsigned characters. */
  44. extern int bytes_compare(P4(byte *, uint, byte *, uint));
  45.  
  46. /* Test whether a string matches a pattern with wildcards. */
  47. /* '*' = any substring, '?' = any character, '\' quotes next character. */
  48. extern int string_match(P4(byte *str, uint len, byte *pstr, uint plen));
  49.  
  50. /* Compute a hash for a string */
  51. extern uint string_hash(P2(byte *, uint));
  52.  
  53. /* Convert a C string to a Ghostscript string */
  54. extern int string_to_ref(P3(char *, ref *, char *));
  55.  
  56. /* Convert a Ghostscript string to a C string. */
  57. /* Return 0 iff the buffer can't be allocated. */
  58. extern char *ref_to_string(P2(ref *, char *));
  59.  
  60. /* ------ Operand utilities ------ */
  61.  
  62. /* Get N numeric operands from the stack. */
  63. /* Note that the first argument must be ref * rather than os_ptr, */
  64. /* because num_params is sometimes used elsewhere than */
  65. /* on the operand stack. */
  66. extern int num_params(P3(ref *, int, float *));
  67.  
  68. /* Get a real parameter. */
  69. extern int real_param(P2(ref *, float *));
  70.  
  71. /* Check for a matrix operand with read access. */
  72. struct gs_matrix_s;
  73. extern int read_matrix(P2(ref *, struct gs_matrix_s *));
  74.  
  75. /* Check for a matrix operand with write access. */
  76. extern int write_matrix(P1(ref *));
  77.